<template>
  <view class="user-info-wrap">
    <view class="user-info">
      <view class="user-top">
        <u-avatar src="/static/index/login-header.png" size="32" />
        <text class="username-one">{{ userRoleName }}</text>
      </view>
      <text class="username">湖北道路运输服务</text>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      userRoleName: "",
    };
  },
  mounted() {
    // 从本地存储获取用户角色名称
    this.userRoleName = uni.getStorageSync("userRoleName") || "未知用户";
  },
};
</script>

<style lang="scss" scoped>
.user-info-wrap {
  position: absolute;
  bottom: -40px;
  left: 0;
  right: 0;
  padding: 0 20px;
  box-sizing: border-box;
  z-index: 10;
}

.user-info {
  display: flex;
  align-items: center;
  background-color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-top {
  display: flex;
  align-items: center;
  border-radius: 30px;
  border: 1px solid #e7ebf5;
  padding: 5px;
}

.username-one {
  margin-left: 10px;
  font-size: 12px;
  font-weight: 300;
  color: #79829c;
}

.username {
  margin-left: 10px;
  font-size: 14px;
  font-weight: bold;
  color: #0d1444;
}
</style>
